import java.util.*;
public class Lab10Task04 {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
int n;
do {
System.out.print("Enter the array size: ");
n=kb.nextInt();
if(n<1)
System.out.println("Error: the array size is <= 0");
}while(n<1);
double[]x=new double[n];
System.out.printf("Enter %d values:%n",n);
for(int i=0;i<n;i++) {
x[i]=kb.nextDouble();
}
double[]rev=reverseArray(x);
System.out.print("The reverse array is: ");
for(int i=0;i<rev.length;i++) {
System.out.print(rev[i]+" ");
}
kb.close();
}public static double[] reverseArray(double[]x) {
double[]rev= new double[x.length];
for(int i=0;i<x.length;i++) {
rev[i] = x[x.length-(i+1)];
}
return rev;
}
}
